package com.amumu.drama.mapper;

import com.amumu.drama.common.dto.GameTemplateDTO;
import com.amumu.drama.model.PmsProductTemplate;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

/**
 * @author xcj
 * @date 2024/04/02
 */

public interface PmsProductTemplateMapper extends BaseMapper<PmsProductTemplate> {

    Page<GameTemplateDTO> pageGameTemplateList(Page page, @Param(value = "name") String name, @Param(value = "templateName") String templateName);

    default PmsProductTemplate selectByGameId(Long productCategoryId) {
        return selectOne(new QueryWrapper<PmsProductTemplate>().eq("product_category_id", productCategoryId)
                .eq("delete_status", 0));
    }
}
